package com.fhsk.file.common.enums;

/**
 * 清晰度：1低，2中，3高
 */
public enum ClarityEnum {
    LOW(1, "低"),
    MIDDLE(2, "中"),
    HIGH(3, "高");

    private final Integer code;
    private final String value;

    ClarityEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    /**
     * 获取指定参数code的枚举code值
     *
     * @param code
     * @return
     */
    public static Integer getClarityByCode(Integer code) {
        ClarityEnum[] enums = ClarityEnum.values();
        for (ClarityEnum anEnum : enums) {
            if (anEnum.code.equals(code)) {
                return anEnum.code;
            }
        }
        return null;
    }
}
